<template>
	<view class="consumption page-background">
		<view v-for="(item, index) in list" :key="index" class="item item-box">
			<view class="title">
				{{item.content}}
			</view>
			<view class="content">
				消费
			</view>
			<view class="content">
				{{item.createDate | toFullTimeString}}
			</view>
			<view class="price">
				-¥<text>{{Math.abs(item.amount) | floorTwo}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	import { mapState, mapGetters, mapMutations } from 'vuex'
	export default {
		data() {
			return {
				clubId: '',
				list:[],
			};
        },
        onLoad(data) {
			this.clubId = data.clubId || ''
			this.init()
        },
		computed:{
			...mapState(['userInfo','accessToken']),
		},
        methods:{
            async init() {
            	const param = {
            		'ACCESS-TOKEN': this.accessToken
            	}
            	const res = await this.$api.getClubRecordsList(param, this.clubId)
            	if(res && res.code == 200) {
            		this.list = res.data
            	}
            }
        }
	}
</script>

<style scoped lang="scss">
	.consumption{
		min-height: 100vh;
		overflow: hidden;
		.item{
			height: 190rpx;
			display: flex;
			justify-content: space-between;
			flex-flow: column;
			position: relative;
			padding: 25rpx;
			.title{
				font-size: 32rpx;
			}
			.content{
				color: $text-color-grey;
				font-size: 28rpx;
			}
			.price{
				position: absolute;
				right: 20rpx;
				top: 25rpx;
				font-size: 24rpx;
				color: $public-color-yellow1;
				text{
					font-size: 36rpx;
				}
			}
		}
	}
</style>
